package com.hege.service.impl;

import com.hege.domain.SysUser;
import com.hege.mapper.SysUserDao;
import com.hege.service.UserService;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author hege
 * @Date 2020/11/22 21:53
 * @Version 1.0
 */
@Service
@Slf4j //使用lombok的注解
public class UserServiceImpl implements UserService {

//    private static final Logger log = LoggerFactory.getLogger(UserServiceImpl.class);

    @Autowired
    private SysUserDao sysUserDao;

    @Override
    public SysUser queryUserById(long id) {

        log.info("开始查询用户: {}",sysUserDao.selectByPrimaryKey(id));

        return sysUserDao.selectByPrimaryKey(id);
    }
}
